const Mock = require('mockjs')

// 列表
const list = [
  {
    id: 1,
    title: '系统管理',
    children: [
      {
        id: 2,
        title: '菜单管理',
        children: []
      },
      {
        id: 3,
        title: '角色管理'
      },
      {
        id: 4,
        title: '用户管理'
      }
    ]
  }
]

const menuList = {
  url: '/api/menu/list',
  type: 'get',
  data: Mock.mock({
    code: 200,
    msg: 'ok',
    data: list
  })
}

const addMenu = {
  url: '/api/menu/add',
  type: 'post',
  data: Mock.mock('/api/menu/add', 'post', (options) => {
    console.log(options)
    return {
      code: 200,
      msg: 'ok',
      data: list
    }
  })
}

module.exports = [menuList, addMenu]
